package com.github.appintro.example.ui.custom;

import com.github.appintro.AppIntro;
import com.github.appintro.AppIntroCustomLayoutFragment;
import com.github.appintro.example.ui.ResourceTable;
import ohos.aafwk.content.Intent;
import ohos.agp.components.Component;

public class CustomLayoutIntro extends AppIntro {
    @Override
    public void onStart(Intent savedInstanceState) {
        setLayoutId();
        super.onStart(savedInstanceState);
        this.addSlide(new AppIntroCustomLayoutFragment(this, ResourceTable.Layout_intro_custom_layout1));
        this.addSlide(new AppIntroCustomLayoutFragment(this, ResourceTable.Layout_intro_custom_layout2));
        this.addSlide(new AppIntroCustomLayoutFragment(this, ResourceTable.Layout_intro_custom_layout3));
        this.addSlide(new AppIntroCustomLayoutFragment(this, ResourceTable.Layout_intro_custom_layout4));
        this.showStatusBar(true);
        this.setStatusBarColorRes(ResourceTable.Color_orange);
        this.setNavBarColorRes(ResourceTable.Color_orange);
        this.setProgressIndicator();
    }

    public void onSkipPressed(Component currentFragment) {
        super.onSkipPressed(currentFragment);
        terminateAbility();
    }

    public void onDonePressed(Component currentFragment) {
        super.onDonePressed(currentFragment);
        terminateAbility();
    }
}
